﻿<html>
<head>
    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=yes">
    <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>用户修改</title>
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/ajz/mobile/css/iconfont.css?Timestamp=${Timestamp}">
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/ajz/mobile/css/mdialog.css?Timestamp=${Timestamp}">
    <link type="text/css" rel="stylesheet" href="${ctxStatic}/ajz/mobile/css/sf.css?Timestamp=${Timestamp}"/>
    <link type="text/css" rel="stylesheet" href="${ctxStatic}/ajz/mobile/css/index.css?Timestamp=${Timestamp}"/>
    <link type="text/css" rel="stylesheet" href="${ctxStatic}/ajz/mobile/css/checkbox.css?Timestamp=${Timestamp}"/>
    <link type="text/css" rel="stylesheet" href="${ctxStatic}/ajz/mobile/css/add_baseinfo.css?Timestamp=${Timestamp}"/>
    <script type="text/javascript" src="${ctxStatic}/ajz/mobile/js/jquery.min.js?Timestamp=${Timestamp}"></script>
    <style>
        .radio_houseType {
            float: left;

            padding-left: 35px;

        }

        .imgContainer {
            width: 80%;
            height: 50%;
            margin-left: 10%;
        }

        .imgContainer img {
            width: 100%;
            height: 100%;
            display: inline-block;
        }
    </style>
</head>
<body>
<form name="updateHouseInfo" id="updateHouseInfo" method="post" action="${ctx}/ajz/ajzHouseInfo/updateHouseInfo">
    <div id="sacnboxs"></div>
    <hr class="line_hr_add">
    <h3 class="qy_t">
        <span class="qy_ba">&nbsp;</span> 基 础 信 息</h3>
    <ul class="table_information">
        <div class="aqsc">
            <input class="aqsc" type="hidden" name="id" value="${ajzHouseInfo.id}">
            <hr class="line_hr_add czw">
            <li class="aqsc"><i>所属社区：</i>
                <b>
                    <select class="aqsc" name="office.officeCode">
                        <% for(office in officeList){ %>
                        <option value="${office.officeCode}">${office.officeName}</option>
                        <% } %>
                    </select>
                </b>
            </li>


            <li class="aqsc"><i>联系人：</i>
                <b><input type="text" class="table_text_box username_czw" id="contactPerson"
                          name="contactPerson" value="${ajzHouseInfo.contactPerson}" placeholder="请输入联系人姓名"></b>
                <div class="must"></div>
            </li>
            <li class="aqsc"><i>联系电话：</i>
                <b><input type="text" class="table_text_box cell_czw" name="contactPersonTel"
                          value="${ajzHouseInfo.contactPersonTel}" maxlength=11 placeholder="请输入联系人电话"
                          onKeyUp="value=value.replace(/\D/g,'')" onafterpaste="value=value.replace(/\D/g,'')"></b>
                <div class="must"></div>
            </li>
            <li class="aqsc"><i>法 人：</i><b><input type="text" class="table_text_box" id="chargePerson"
                                                  name="chargePerson"
                                                  value="${ajzHouseInfo.chargePerson}"
                                                  placeholder="请输入法定代表人姓名"></b></li>
            <li class="aqsc"><i>联系电话：</i><b><input type="text" class="table_text_box" name="chargePersonTel"
                                                    maxlength=11
                                                    value="${ajzHouseInfo.chargePersonTel}"
                                                    placeholder="请输入法定代表电话"

                                                    onafterpaste="value=value.replace(/\D/g,'')"></b></li>
            <li class="aqsc"><i>地址：</i><b><input type="text" class="table_text_box address_czw" id="addr" name="addr"
                                                 value="${ajzHouseInfo.addr}"
                                                 placeholder="请输入具体地址"></b>
                <div class="must"></div>
            </li>
            <li class="aqsc">
                <i>建筑层数：</i>
                <b>
                    <input type="text" name="floorCount" class="table_text_box" placeholder="请输入建筑层数"
                           value="${ajzHouseInfo.floorCount}"
                           onKeyUp="value=value.replace(/\D/g,'')" onafterpaste="value=value.replace(/\D/g,'')">
                </b>
            </li>
            <li class="aqsc"><i>建筑面积：</i><b><input type="text" class="table_text_box" name="area"
                                                   placeholder="请输入建筑面积(平方米)"
                                                   value="${ajzHouseInfo.area}"></b>
            <li class="aqsc">

                <i>房屋类别：</i>
                <label class="radio_houseType">
                    <input type="radio" name="houseType" value="1"  ${ajzHouseInfo.houseType =='1' ?'checked' :''}/>群租房
                </label>
                <label class="radio_houseType">
                    <input type="radio" name="houseType" value="2"  ${ajzHouseInfo.houseType =='2' ?'checked' :''}/>一改多
                </label>
                <label class="radio_houseType">
                    <input type="radio" name="houseType" value="3"  ${ajzHouseInfo.houseType =='3' ?'checked' :''}/>单间
                </label>
            <li class="aqsc"><i>风险等级：</i>
                <b>
                    <select name="dangerLev">
                        <option value="三等风险">三等风险</option>
                        <option value="二等风险">二等风险</option>
                        <option value="一等风险">一等风险</option>
                    </select>
                </b>
            </li>
            <hr class="line_hr_add czw">
        </div>

    </ul>


    <h3 class="qy_t qy_t_box"><span class="qy_ba">&nbsp;</span>涉 及 类 型</h3>
    <div class="switch_Box_p">
        <li>
            <span class="switch_box_span">天然气</span>
            <div class="switch_box box_1">
                <input type="checkbox" class="switch_1" id="deadLine_trq">
            </div>
        </li>
        <li>
            <span class="switch_box_span">液化气</span>
            <div class="switch_box box_1">
                <input type="checkbox" class="switch_1" id="deadLine_yhq">
            </div>
        </li>
        <li>
            <span class="switch_box_span">食品安全</span>
            <div class="switch_box box_1">
                <input type="checkbox" class="switch_1" id="deadLine_spaq">
            </div>
        </li>

    </div>

    <ul class="table_information" style="margin:0px;padding: 0px;">
        <li class="trq"><i>天然气性质：</i>
            <input type="hidden" value="0">
            <b>
                <select class="trq_rqse" name="ajzNaturalGas.naturalGasNature">
                    <option value="1">营业用户</option>
                    <option value="2">民用户</option>
                </select>
            </b>
        </li>
        <li class="trq">
            <i>天然气合同：</i>
            <b><input style="width: 67%" type="text" name="ajzNaturalGas.naturalGasContract" class="table_text_box"
                      id="naturalGasContract"
                      value="${ajzHouseInfo.ajzNaturalGas.naturalGasContract}" placeholder="请输入天然气合同编号"><input
                    type="hidden" value="0"></b></li>

        <li class="yhq"><i>液化气性质：</i>
            <input type="hidden" value="0">
            <b>
                <select class="rqse" name="ajzLiquefiedGas.liquefiedGasNature">
                    <option value="1">营业用户</option>
                    <option value="2">民用户</option>
                </select>
            </b>
        </li>
        <li class="yhq">
            <i>液化气合同：</i>
            <b><input style="width: 67%" type="text" name="ajzLiquefiedGas.liquefiedGasContract" class="table_text_box"
                      id="liquefiedGasContract"
                      value="${ajzHouseInfo.ajzLiquefiedGas.liquefiedGasContract}" placeholder="请输入液化气合同编号"><input
                    type="hidden" value="0"></b></li>
    </ul>
    <hr class="line_hr_add">

    <div class="hi_degbtnbar_iup btn_box_bgcolor">
        <a href="javascript:history.go(-1);" class="xgbtn_a_3" style="">返 回</a>
        <!--<input type="submit" name="" value="提 交" class="table_btn xgbtn_a_4" id="btn_paicha">-->
        <a href="javascript:void(0)" class="table_btn xgbtn_a_4" id="btn_paicha" onclick="sub()">提 交</a>
    </div>
</form>
<%
include("/layouts/mask.html"){}
%>
<script type="text/javascript" src='${ctxStatic}/ajz/mobile/js/add_baseinfo.js?Timestamp=${Timestamp}'></script>
<script type="text/javascript" src="${ctxStatic}/ajz/mobile/js/vue.min.js?Timestamp=${Timestamp}"></script>
<script type="text/javascript" src="${ctxStatic}/ajz/mobile/js/zepto.min.js?Timestamp=${Timestamp}"></script>
<script type="text/javascript" src="${ctxStatic}/ajz/mobile/js/mdialog.js?Timestamp=${Timestamp}"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js?Timestamp=${Timestamp}"></script>
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/ajz/mobile/js/add_wxpic.js?Timestamp=${Timestamp}" ></script>
<script src="${ctxStatic}/ajz/mobile/js/sf.js?Timestamp=${Timestamp}"></script>
<script type="text/javascript">

    wx.config({
        debug: false,
        appId: '${appId}',
        timestamp: '${timestamp}',
        nonceStr: '${nonceStr}',
        signature: '${signature}',
        jsApiList: [
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'scanQRCode'
        ]
    });

    /*给图片上传绑定动态按钮*/
    function updateImg(tin) {
        var btnId = $(tin).parent().next().attr('id');//获取当前元素的父元素的下一个元素
        var inputVal = $(tin).attr('value');//获取当前点击元素的vlaue
        upload(btnId, inputVal);
    }

    $(".imgContainer img").on("click", function () {
        if ($(this).next("span").text() == '0') {
            $(this).parent().addClass("img_a_b");
            $(this).css({"position": "fixed", "top": "0", "left": "0px", "z-index": "102", "height": "100%"});
            $(this).next("span").text('1')
        } else if ($(this).next("span").text() == '1') {
            $(this).css({"display": "block", "position": "relative", "top": "0", "left": "0px", "z-index": "1"});
            $(this).parent().removeClass("img_a_b");
            $(this).next("span").text('0')
        }
    })



    //获取下拉框的值并选中对应的值
    var officeCode = '${ajzHouseInfo.office.officeCode}';
    $("select[name='office.officeCode'] option[value=" + officeCode + "]").prop("selected", "selected");
    var dangerLev = '${ajzHouseInfo.dangerLev}';
    $("select[name='dangerLev'] option[value=" + dangerLev + "]").prop("selected", "selected");

    //天然气等其他类别
    //天然气合同
    var naturalGasContract = '${ajzHouseInfo.ajzNaturalGas.naturalGasContract}';
    //天然气性质
    var naturalGasNature = '${ajzHouseInfo.ajzNaturalGas.naturalGasNature}';
    if (naturalGasContract) {
        $("#deadLine_trq").prop("checked", "checked");
        $(".trq").css("display", "block");
    }
    //天然气性质下拉选默认值
    $("select[name='ajzNaturalGas.naturalGasNature'] option[value=" + naturalGasNature + "]").prop("selected", "selected");
    //液化气
    //液化气合同
    var liquefiedGasContract = '${ajzHouseInfo.ajzLiquefiedGas.liquefiedGasContract}';
    //液化气性质
    var liquefiedGasNature = '${ajzHouseInfo.ajzLiquefiedGas.liquefiedGasNature}';

    if (liquefiedGasContract) {
        //液化气性质下拉选默认值
        $("select[name='ajzLiquefiedGas.liquefiedGasNature'] option[value=" + liquefiedGasNature + "]").prop("selected", "selected");
        $("#deadLine_yhq").prop("checked", "checked");
        $(".yhq").css("display", "block");
    }



    //验证并提交
    function sub() {

        if ($(".username_czw").val() == "") {
            $(".username_czw").css("border", "1px solid #f00")
            new TipBox({type: 'error', str: '请填写联系人姓名', hasBtn: true});
            return false
        }
        else if ($(".cell_czw ").val() == "") {
            $(".cell_czw").css("border", "1px solid #f00")
            new TipBox({type: 'error', str: '请填写联系人电话', hasBtn: true});
            return false
        }
        else if ($(".address_czw").val() == "") {
            $(".address_czw").css("border", "1px solid #f00")
            new TipBox({type: 'error', str: '请填写所在地址', hasBtn: true});
            return false
        } else {
            //开启遮罩并提交
            VerifyAndsubmit("updateHouseInfo");
        }
    }


</script>
</body>
</html>



